/*
    pythonswitcher Header file
    Usage   : Contain all functions to switch between the versions
    
    Copyright (C) 2013  Charles-Eugene LOUBAO

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

switch_to_py2()
{  
    printf("Getting Root access...\n");
    system("sudo rm -f ~/charly1811");
    printf("Removing old python symlink...\n");
    system("sudo rm -f /usr/bin/python");
    printf("Switching to python2 :\n");
    system("sudo ln -s \"/usr/bin/python2\" /usr/bin/python");
    
    printf("Switched to python2\n");
    printf("You are using now :\n");
    system("python --version");
    printf("***************************************************************\n");
    
    return 0;
}

switch_to_py3()
{  
    printf("Getting Root access...\n");
    system("sudo rm -f ~/charly1811");
    printf("Removing old python symlink...\n");
    system("sudo rm -f /usr/bin/python");
    printf("Switching to python3 :\n");
    system("sudo ln -s \"/usr/bin/python3\" /usr/bin/python");
    
    printf("Switched to python3\n");
    printf("You are using now :\n");
    system("python --version");
    printf("***************************************************************\n");
    
    return 0;
}

